In modern computer systems, only the operating system can directly do anything with disk files. How does this:
As far as the hard disk is concerned, all files are the same. At the electronic level, there is no difference between a file containing a program and a file containing data. All files are named collections of bytes. Of course, what the files are used for is different. The operating system can take a program file, copy it into main memory, and start it running. The operating system can take a data file, and supply its information to a running program when it asks.
Often then last part of a file's name (the extension) shows what the file is expected to be used for. For example, in "mydata.txt" the ".txt" means that the file is expected to be used as a collection of text, that is, characters. With "Netscape.exe" the ".exe" means that the file is an "executable," that is, a program that is ready to run. With "program1.java" the ".java" means that the file is a source program in the language java (there will be more about source programs later on in these notes.) To the hard disk, each of these files is the same sort of thing: a collection of bytes.
What happens when a file is used in a way other than its intended use? For example, what happens if you try to use a word processor on an ".EXE" file?